//
//  GZViewController.m
//  GZLog
//
//  Created by GuoRui on 12/21/2018.
//  Copyright (c) 2018 GuoRui. All rights reserved.
//

#import "GZViewController.h"
#import "GZLogManager.h"
#import "GZConsoleLogger.h"
#import "GZFileLogger.h"
#import "GZLogDefines.h"

@interface GZViewController ()

@end

@implementation GZViewController

+ (void)load {
    GZConsoleLogger *consoleLogger = [[GZConsoleLogger alloc] init];
    [[GZLogManager sharedInstance] addLogger:consoleLogger];
    
    GZFileLogger *fileLogger    = [[GZFileLogger alloc] init];
    [[GZLogManager sharedInstance] addLogger:fileLogger];
}
    
- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
       
        for (int i = 0; i < 10000; i++) {
            GZLogI(AAA, @"Thread1 %d", i);
            GZDataLogD(BBB, @"Thread1", @"这是第%d个", i);
        }
        
    });
    
    
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
        
        for (int i = 0; i < 10000; i++) {
            GZLogI(AAA, @"Thread2 %d", i);
            GZDataLogD(BBB, @"Thread2", @"这是第%d个", i);
        }
        
    });
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
